<?php

if (!defined('PUBLIC_HTML'))
{
	exit;
}

$menu_id	= (isset($_GET['id'])) 		? (is_numeric($_GET['id']) ? intval($_GET['id']) : 0) : 0;
$submit		= (isset($_POST['submit'])) ? true : false;
$page_title = 'Are you sure you want to delete this menu item?';

if ($menu_id == 0 || !$database->sqlCount(TABLE_MENU, 'men_id', $menu_id) == 1)
{
	if (!$ajax)
	{
		redirect('cms.php?p=menu');
	}
	exit;
}

$tpl_vars['ID'] = $menu_id;

if ($submit)
{
	$database->sqlDelete(TABLE_MENU, 'men_id', $menu_id);
	if (!$ajax)
	{
		redirect('cms.php?p=menu');
	}
	exit;
}

?>